<?php
namespace RMD\AccountBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Doctrine\Common\Persistence\ObjectManager;

use RMD\AccountBundle\Form\DataTransformer\TestTransformer;

class TrollType extends AbstractType
{
    private $om;

    public function __construct(ObjectManager $om)
    {
        $this->om = $om;
    }

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $transformer = new TestTransformer($this->om);
        $builder->prependNormTransformer($transformer);
    }

    public function getDefaultOptions(array $options)
    {
        return array(
            'invalid_message' => 'The selected issue does not exist',
        );
    }

    public function getParent(/*array $options*/)
    {
        return 'choice';
    }

    public function getName()
    {
        return 'troll_type';
    }
}
